import request from '@/router/axios';
import { baseUrl } from '@/config/env';
export const listRole = (data) => request({
    url: baseUrl + '/sys/sysRole/page',
    method: 'post',
    data: data
});
export const listPermission = () => request({
    url: baseUrl + '/sys/sysPermission/list/permission',
    method: 'get',
});
export const listRolePermission = (roleId) => request({
    url: baseUrl + '/sys/sysPermission/list/'+roleId,
    method: 'get',
});
export const listRoleDept = (roleId) => request({
    url: baseUrl + '/sys/sysDepartment/list/'+roleId,
    method: 'get',
});
export const addRole = (data) => request({
    url: baseUrl + '/sys/sysRole',
    method: 'post',
    data: data
});

export const startRole = (data) => request({
    url: baseUrl + '/sys/sysRole/start',
    method: 'put',
    params: data
});

export const delRole = (ids) => request({
    url: baseUrl + '/sys/sysRole/' + ids,
    method: 'delete',
});
export const updateRole = (data) => request({
    url: baseUrl + '/sys/sysRole',
    method: 'put',
    data: data
});

